import 'package:flutter/services.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import 'package:qm_line/model/message.dart';

import 'qm_line_method_channel.dart';
import 'model/response.dart';

abstract class QmLinePlatform extends PlatformInterface {
  /// Constructs a QmLinePlatform.
  QmLinePlatform() : super(token: _token);

  static final Object _token = Object();

  static QmLinePlatform _instance = MethodChannelQmLine();

  /// The default instance of [QmLinePlatform] to use.
  ///
  /// Defaults to [MethodChannelQmLine].
  static QmLinePlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [QmLinePlatform] when
  /// they register themselves.
  static set instance(QmLinePlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  void addEventHandler(Future<dynamic> Function(MethodCall)? handler) {
    throw UnimplementedError('has not been implemented.');
  }

  void switchServiceRoute(QMServiceLine serviceLine) {
    throw UnimplementedError('has not been implemented.');
  }

  Future<QMResponse> initSDK(String accessId, String userName, String userId) {
    throw UnimplementedError('has not been implemented.');
  }

  void quitSDK() {
    throw UnimplementedError('has not been implemented.');
  }

  Future<QMResponse> beginChatSession(String peerId, Map<dynamic, dynamic> param) {
    throw UnimplementedError('has not been implemented.');
  }

  Future<QMResponse> sendTextMessage(String text) {
    throw UnimplementedError('has not been implemented.');
  }

  Future<QMResponse> sendImageMessage(String imagePath) {
    throw UnimplementedError('has not been implemented.');
  }

  Future<QMResponse> sendFileMessage(String filePath, String fileName, String fileSize) {
    throw UnimplementedError('has not been implemented.');
  }

  Future<QMResponse> resendMessage(String messageId) {
    throw UnimplementedError('has not been implemented.');
  }

  Future<QMResponse> leaveMessage(String peerId, String message) {
    throw UnimplementedError('has not been implemented.');
  }

  Future<QMResponse> getMessageList(int page) {
    throw UnimplementedError('has not been implemented.');
  }

  Future<QMResponse> getMessage(String messageId) {
    throw UnimplementedError('has not been implemented.');
  }

  Future<QMResponse> deleteMessage(String messageId) {
    throw UnimplementedError('has not been implemented.');
  }

  Future<QMResponse> getUnreadMessageCount(String accessId, String username, String userId) {
    throw UnimplementedError('has not been implemented.');
  }

  Future<QMResponse> getUnreadMessageList(String afterMsgId) {
    throw UnimplementedError('has not been implemented.');
  }
}

enum QMServiceLine { aliy, tencent }
